import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.Tag;

public class IfTag extends BodyTagSupport {
    private boolean test;

    public IfTag() {
        super();
    }

    @Override
    public void setParent(Tag t) {

    }

    @Override
    public int doStartTag() throws JspException {
        if (test){
            return BodyTagSupport.EVAL_BODY_INCLUDE;
        }else{
            return super.doStartTag();
        }
    }

    @Override
    public int doEndTag() throws JspException {
        return BodyTagSupport.SKIP_BODY;
    }

    @Override
    public void setBodyContent(BodyContent b) {
        super.setBodyContent(b);
    }
}
